package com.game.worm.mobile.view.list.typelist;

import com.dx.as.http.IHttpListener;
import com.game.worm.mobile.bean.GameBean;
import com.game.worm.mobile.view.common.CommonFragment;
import com.game.worm.mobile.view.http.HttpHelper;

import java.util.List;

/**
 * Created by d_xxiang on 2018/5/22.
 */

public class SingeFragment extends CommonFragment {
    @Override
    public void dataOpion() {
        getListData();
    }

    private void getListData(){
        HttpHelper.getSingleList(1, iHttpListener);
    }

    private IHttpListener iHttpListener = new IHttpListener() {
        @Override
        public void onFilure(int code, String errorMsg) {
        }

        @Override
        public void onResponse(Object response, int flg) {
            if (response != null){
                adpater.addData((List<GameBean>)response);
                adpater.notifyDataSetChanged();
            }
        }

        @Override
        public void onFailure(Throwable t) {
        }
    };
}
